function ObserverList(){
	this.subjects = [];
}

ObserverList.prototype.total = function(){
	return this.subjects.length;
};

ObserverList.prototype.add = function(obj){
	return this.subjects.push(obj);
};

ObserverList.prototype.reset = function(){
	this.subjects = [];
};

ObserverList.prototype.get = function(i){
	if(typeof(i)=="number" && i>-1 && i< this.subjects.length)
	return this.subjects[i];
	return undefined;
};

ObserverList.prototype.remove = function(i){
	if(typeof(i)!="number" && i<0)
	return false;
	if(i==0){
		this.subjects.shift();
	}else if(i==this.subjects.length-1){
		this.subjects.shift();
	}else{
		var head   = this.subjects.slice( 0, i );
        var tail   = this.subjects.slice( i + 1);
        this.subjects = head.concat(tail);
	}
	return true;
};

ObserverList.prototype.indexOf = function(obj){
	var positionInList = -1;
	for(var i=0; i < this.subjects.length; i++){
		if(this.subjects[i] == obj){
			positionInList = i;
			break;
		}
	}
	return positionInList;
};